home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / ABox.v1.8 / Header Files / ABUFSSpecs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-23  |  6.4 KB  |  178 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was created & modified by George (ty) Tempel in 
  8.     connection with TopSoft, Inc. from Apple DTS source code:
  9.     
  10.         Apple Macintosh Developer Technical Support
  11.     
  12.         A collection of useful high-level File Manager routines.
  13.     
  14.         by Jim Luther, Apple Developer Technical Support
  15.     
  16.         from File:        MoreFilesExtras.c
  17.     
  18.         Copyright © 1992-1994 Apple Computer, Inc.
  19.         All rights reserved.
  20.     
  21.         You may incorporate this sample code into your applications without
  22.         restriction, though the sample code has been provided "AS IS" and the
  23.         responsibility for its operation is 100% yours.  However, what you are
  24.         not permitted to do is to redistribute the source as "DSC Sample Code"
  25.         after having made changes. If you're going to re-distribute the source,
  26.         we require that you make it clear in the source that the code was
  27.         descended from Apple Sample Code, but that you've made changes.
  28.  
  29.     See the Modification History for more details.
  30.  
  31. Product
  32.     About Box
  33.  
  34. FILE
  35.     ABUFSSpecs.c
  36.  
  37. NAME
  38.     ABUFSSpecs.h, part of the ABox project source code,
  39.     responsible for utility handling the AboutBox FSSpecs stuff.
  40.  
  41. DESCRIPTION
  42.     This file contains defines and prototypes for the ABUFSSpecs
  43.     utility class.
  44.     
  45. DEVELOPED BY
  46.     George (ty) Tempel                netromancr@aol.com
  47.     All code in this file, and its associated header file was
  48.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  49.     "FilterTop" application development, except where noted.
  50.  
  51. CARETAKER - George (ty) Tempel <netromancr@aol.com>
  52.      Please consult this person for any changes or suggestions to this file.
  53.  
  54. MODIFICATION HISTORY
  55.  
  56.     dd mmm yy    -    xxx    -    patchxx: description of patch
  57.     15 july 94    -    ty    -    Initial Version Created
  58.     20-july-94    -    ty    -    initial version released
  59.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  60.                             release and the associated Universal Headers from Apple:
  61.                             most methods that returned references now have "Ref" at
  62.                             the end of their methods names to prevent possible collisions
  63.                             with datatypes and classes of the same name (older versions
  64.                             of the compiler didn't have a problem with this).
  65.  
  66. */
  67.  
  68.  
  69. /*****************************************************************************/
  70.  
  71. class    ABUFSSpecs
  72. {
  73.     public:
  74.                             ABUFSSpecs(void);
  75.             virtual            ~ABUFSSpecs(void);
  76.             
  77.             static pascal    OSErr    GetDirID(short vRefNum,
  78.                                      long dirID,
  79.                                      StringPtr name,
  80.                                      long *theDirID,
  81.                                      Boolean *isDirectory);
  82. /*    Use GetDirID to get the directory ID number of the directory
  83.     specified.  If a file is specified, then the parent
  84.     directory of the file is returned and isDirectory is false.  If
  85.     a directory is specified, then that directory's ID number is
  86.     returned and isDirectory is true.
  87.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  88.     mounted volumes can have the same name. For this reason, the use of a
  89.     volume name or full pathname to identify a specific volume may not
  90.     produce the results you expect.  If more than one volume has the same
  91.     name and a volume name or full pathname is used, the File Manager
  92.     currently uses the first volume it finds with a matching name in the
  93.     volume queue.
  94.     
  95.     vRefNum            input:    Volume specification.
  96.     dirID            input:    Directory ID.
  97.     name            input:    Pointer to object name, or nil when dirID
  98.                             specifies a directory that's the object.
  99.     theDirID        output:    If the object is a file, then its parent directory
  100.                             ID. If the object is a directory, then its ID.
  101.     isDirectory        output:    True if object is a directory; false if
  102.                             object is a file.
  103. */
  104.  
  105.  
  106.             static pascal    OSErr    DirIDFromFSSpec(const FSSpec *spec,
  107.                                             long *dirID,
  108.                                             Boolean *isDirectory);
  109. /*    Use DirIDFromFSSpec to get the directory ID number of the directory
  110.     specified by spec. If spec is to a file, then the parent
  111.     directory of the file is returned and isDirectory is false.  If
  112.     spec is to a directory, then that directory's ID number is
  113.     returned and isDirectory is true.
  114.     
  115.     spec            input:    An FSSpec record specifying the directory.
  116.     theDirID        output:    The directory ID.
  117.     isDirectory        output:    True if object is a directory; false if
  118.                             object is a file.
  119. */
  120.  
  121.  
  122.             static pascal    OSErr    DetermineVRefNum(StringPtr pathname,
  123.                                              short vRefNum,
  124.                                              short *realVRefNum);
  125. /*    Use DetermineVRefNum to determine the volume reference number of a
  126.     volume from a pathname, a volume specification, or a combination
  127.     of the two.
  128.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  129.     mounted volumes can have the same name. For this reason, the use of a
  130.     volume name or full pathname to identify a specific volume may not
  131.     produce the results you expect.  If more than one volume has the same
  132.     name and a volume name or full pathname is used, the File Manager
  133.     currently uses the first volume it finds with a matching name in the
  134.     volume queue.
  135.  
  136.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  137.                         partial pathname, it is ignored. A full pathname to a
  138.                         volume must end with a colon character (:).
  139.     vRefNum        input:    Volume specification (volume reference number, working
  140.                         directory number, drive number, or 0).
  141.     realVRefNum    output:    The real volume reference number.
  142. */
  143.  
  144.  
  145.             static pascal    OSErr    GetDirItems(short vRefNum,
  146.                                         long dirID,
  147.                                         StringPtr name,
  148.                                         Boolean getFiles,
  149.                                         Boolean getDirectories,
  150.                                         FSSpecPtr items,
  151.                                         short reqItemCount,
  152.                                         short *actItemCount,
  153.                                         short *itemIndex);
  154. /*    Use GetDirItems to return a list of items in a directory.
  155.  
  156.     vRefNum            input:    Volume specification.
  157.     dirID            input:    Directory ID.
  158.     name            input:    Pointer to object name, or nil when dirID
  159.                             specifies a directory that's the object.
  160.     getFiles        input:    Pass true to have files added to the items list.
  161.     getDirectories    input:    Pass true to have directories added to the
  162.                             items list.
  163.     items            input:    Pointer to array of FSSpec where the item list
  164.                             is returned.
  165.     reqItemCount    input:    Maximum number of items to return (the number
  166.                             of elements in the items array).
  167.     actItemCount    output: The number of volumes actually returned.
  168.     itemIndex        input:    The current item index position. Set to 1 to
  169.                             start with the first item in the directory.
  170.                     output:    The item index position to get the next item.
  171.                             Pass this value the next time you call
  172.                             GetDirItems to start where you left off.
  173. */
  174.  
  175. };
  176.  
  177.  
  178. //    end of file.